﻿using Nop.Core.Domain.Media;
using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Nop.Data.Mapping.Media
{
    public partial class SlideshowMap : EntityTypeConfiguration<Slideshow>
    {
        public SlideshowMap ()
	    {
            this.ToTable("Slideshow");
            this.HasKey(s => s.Id);
            this.Property(s => s.Height).IsRequired();
            this.Property(s => s.Width).IsRequired();
            this.Property(s => s.ViewTemplate).IsOptional().HasMaxLength(200);

            this.HasRequired(s => s.PictureLinkCollection)
                .WithMany()
                .HasForeignKey(s => s.PictureLinkCollectionId)
                .WillCascadeOnDelete(false);
        }
    }
}
